<!--
 * @docName: oldSysAccountManage.vue
 * @Author: mwl
 * @Date: 2024/8/8
 * @LastEditors: zhongxiong
 * @LastEditTime: 13:58
-->
<template>
  <div class='content'>

    <div class='header-div'>
      <span class='title'>账户管理</span>
      <balanceQuery :balanceConfig='balanceConfig' @goTo='goTo'></balanceQuery>
    </div>
    <a-tabs default-active-key="1" v-model="activeKey" @change="callback">
      <a-tab-pane key="1" tab="待支付订单">
        <template>
          <div style="border: 1px solid #ececec;border-radius: 4px; margin: 0 0 20px;box-sizing: border-box;padding: 8px;">
            <div style="margin-bottom: 10px;border-bottom: 1px solid #ececec;padding-bottom: 8px">
              <a-checkbox :indeterminate="indeterminate" :checked="checkAll" @change="onCheckAllChange">
                全部订单
              </a-checkbox>
            </div>
            <a-checkbox-group v-model="checkedList" :options="plainOptions" @change="onChange1" />
          </div>
        </template>
        <div class='table-div'>
          <a-table
            ref="table"
            bordered
            class='payment-order'
            rowKey="id"
            :columns="columns"
            :dataSource="tableData"
            :pagination="false"
            :loading="loading"
            :row-selection="rowSelection"
            :scroll="{x:800}"
            @change="handleTableChange">
        <span slot="orderNo" slot-scope="text">
            <div class='table-li' :key="'div-'+index" v-for='(item,index) in text'>{{item}}</div>
        </span>
            <span slot="createTime" slot-scope="text">
            <div class='table-li' :key="'div-'+index" v-for='(item,index) in text'>{{item}}</div>
        </span>
            <span slot="legalName" slot-scope="text">
            <div class='table-li' :key="'div-'+index" v-for='(item,index) in text'><j-ellipsis :value="item" :length="15" /></div>
        </span>
            <!-- 企业所属合作模式 -->
            <span slot="entName" slot-scope="text">
            <div class='table-li' :key="'div-'+index" v-for='(item,index) in text'><j-ellipsis :value="item" :length="15" /></div>
        </span>
            <span slot="protocolType" slot-scope="text">
            <div class='table-li' :key="'div-'+index" v-for='(item,index) in text'>
              {{{1:'渠道总',2:'非渠道总'}[item]}}
            </div>
        </span>
            <span slot="subitem" slot-scope="text">
            <div class='table-li' :key="'div-'+index" v-for='(item,index) in text'>
              <j-ellipsis :value="subitemTypeData.tableTypeKeyName[item]" :length="10" />
            </div>
        </span>
            <span slot="orderStatus" slot-scope="text">
            <div class='table-li':key="'div-'+index" v-for='(item,index) in text'>
              {{{0:'待支付',1:'支付中',2:'已支付',3:'退款中',4:'全额退款',5:'部分退款',6:'已取消',7:'支付失败',8:'线下支付失败',9:'线下支付确认中',11:'支付异常'}[item]}}
            </div>
        </span>
            <span slot="paymentAmount" slot-scope="text">
            <div class='table-li' :key="'div-'+index" v-for='(item,index) in text'>{{item}} 元</div>
        </span>
            <span slot="action" slot-scope="text, record">
             <span v-if='record.orderStatus[0] == 9' style='color: #ccc;'>立即支付</span>
            <a v-else href="javascript:;" @click="singlePaymentFun(record.id)">立即支付</a>
        </span>
          </a-table>
          <div style='margin-top: 10px'>
            <a-button v-if='tableData.length>0' type="primary" @click='batchPaymentFun()' v-prevent-re-click>合并支付</a-button>
          </div>
        </div>
      </a-tab-pane>
      <a-tab-pane key="2" tab="交易记录">
        <div>
          <div class="table-page-search-wrapper" style="margin-top: 10px;">
            <a-form layout="inline">
              <a-row :gutter="24" style="margin-top: 10px">
                <a-col :md="5" :lg="5" :xl="5" :xxl="4">
                  <a-form-item label="企业名称">
                    <a-input placeholder="请输入" v-model="queryParam.entName"></a-input>
                  </a-form-item>
                </a-col>
                <a-col :md="5" :lg="5" :xl="5" :xxl="4">
                  <a-form-item label="交易类型">
                    <a-select v-model="queryParam.subitem" placeholder="请选择交易类型">
                      <a-select-option :key="'select-option-'+index" v-for="(item,index) in subitemTypeData.optionList" :value="item.value">{{ item.label }}</a-select-option>
                    </a-select>
                  </a-form-item>
                </a-col>
                <a-col :md="6" :lg="6" :xl="6" :xxl="4">
                  <a-form-item label="交易发起时间">
                    <a-range-picker
                      v-model="queryParam.time"
                      @change="onChange"
                      format="YYYY-MM-DD HH:mm:ss"
                    />
                  </a-form-item>
                </a-col>
                <a-col :md="8" :sm="10">
            <span  class="table-page-search-submitButtons">
             <a-button type="primary" @click="searchQuerys" icon="search">查询</a-button>
              <a-button @click="searchResets" icon="reload" style="margin-left: 10px">重置</a-button>
              <a-button type="primary" @click="handleExportXlsFun(exportObj)" icon="download" style="margin-left: 10px">导出表单</a-button>
            </span>
                </a-col>
              </a-row>
            </a-form>
          </div>
          <a-table
            ref="table"
            bordered
            rowKey="id"
            :columns="columnsRecord"
            :dataSource="tableData1"
            :pagination="ipagination"
            :loading="loading"
            :scroll="{x:800}"
            @change="handleTableChange">
          <span slot="entName" slot-scope="text, record">
            <j-ellipsis v-if='text && text.length > 0' :value="text" :length="20" />
            <span v-else>名称待定：（ID：{{record.entId}}）</span>
        </span>
            <span slot="subitem" slot-scope="text, record">
              <j-ellipsis :value="subitemTypeData.tableTypeKeyName[text]" :length="10" />
        </span>
            <span slot="orderStatus" slot-scope="text, record">
              <span v-if='record.type ===2'>{{{0:'待退款',1:'退款中',2:'退款成功',3:'退款失败',4:'已取消'}[text]}}</span>
              <span v-else>{{{0:'待支付',1:'支付中',2:'已支付',3:'退款中',4:'全额退款',5:'部分退款',6:'已取消',7:'支付失败',8:'线下支付失败',9:'线下支付确认中',11:'支付处理中'}[text]}}</span>
        </span>
            <span slot='type' slot-scope="text, record">
            {{{1:'支付',2:'退款',null:'--'}[text]}}
          </span>
            <span slot='payerType' slot-scope="text, record">
            {{{1:'渠道通用账户支付',2:'企业通用账户支付',3:'渠道微信扫码',4:'渠道支付宝扫码',5:'企业微信扫码',6:'企业支付宝扫码',7:'渠道税费账户',8:'企业税费账户',9:'线下支付',10:'招行聚合支付',null:'--'}[text]}}
          </span>
            <span slot="paymentAmount" slot-scope="text, record">
              <span v-if='record.type ===2'>
                <span style='color: #6ecd8e' v-if='text !=0'>+{{Math.round(text * 100)/10000}} 元</span>
                <span style='color: #6ecd8e' v-else>{{Math.round(text * 100)/10000}} 元</span>
              </span>
              <span v-else>
                <span style='color: #cc0000' v-if='text !=0'>-{{Math.round(text * 100)/10000}} 元</span>
                <span style='color: #cc0000' v-else>{{Math.round(text * 100)/10000}} 元</span>
              </span>

        </span>
          </a-table>
        </div>
      </a-tab-pane>
    </a-tabs>
  </div>
</template>

<script>
const plainOptions = [{'label':'税费订单','value':'1'},{'label':'服务费订单','value':'2'}];
const defaultCheckedList = [];
import { cloneObject, conversionElement, Storage } from '@/utils/util'
import {
  getBusinessAccountInfo,
  getFundSubBalance,
  getOrderPayPaidList,
  getPayUnpaidList,
  getProtocolType
} from '@api/account'
import { handleExportXlsNew } from '@/common/newHandleExportXls'
import balanceQuery from '@views/myAccount/modules/balanceQuery'
export default {
  name: 'oldSysAccountManage',
  components:{
    balanceQuery
  },
  data() {
    return {
      checkedList: defaultCheckedList,
      indeterminate: false,
      checkAll: false,
      plainOptions:plainOptions,
      taxLIst:[1010, 1011, 1012, 1014, 1015],//税费账户支付项
      subitemList:[],//已选择支付项集合
      compareTheResults:[],//支付项对比后的结果，看是否有税费支付项
      compareTheResultsNo:[],//支付项对比后的结果，看是否有税费支付项取反
      protocolTypeList:[1,2],
      protocolTypeNewList:[],//渠道总非渠道总集合
      timer: null,
      activeKey:'1',
      subitemTypeData :[],
      loading: true,
      toggleSearchStatus: false,
      queryParam: {},
      queryParams: {},
      tableData:[],
      tableData1:[],
      orderNo:[],
      balanceConfig:{
        protocolType:null,
        balanceList:[]
      },
      exportObj:{
        name:'导出明细',
        url:'/qsb/order/pay/paid/list/export'
      },
      columns: [
        /*{

          title: '支付选择',
          align: 'center',
          width: 180,
          dataIndex: 'id',
          scopedSlots: {customRender: 'checkBox'},
        },*/
        {
          title: '创建时间',
          align: 'center',
          width: 180,
          dataIndex: 'createTime',
          scopedSlots: {customRender: 'createTime'},
        },
        {
          title: '订单号',
          align: 'center',
          width: 180,
          dataIndex: 'orderNo',
          scopedSlots: {customRender: 'orderNo'},
        },
        {
          title: '法人姓名',
          align: 'center',
          width: 160,
          dataIndex: 'legalName',
          scopedSlots: {customRender: 'legalName'},
        },
        {
          title: '交易关联企业',
          dataIndex: 'entName',
          align: 'center',
          width: 280,
          scopedSlots: {customRender: 'entName'},
        },
        {
          title: '合作模式',
          dataIndex: 'protocolType',
          align: 'center',
          width: 160,
          scopedSlots: {customRender: 'protocolType'},
        },
        {
          title: '交易类型',
          dataIndex: 'subitem',
          align: 'center',
          width: 180,
          scopedSlots: {customRender: 'subitem'},
        },
        {
          title: '交易状态',
          align: 'center',
          width: 180,
          dataIndex: 'orderStatus',
          scopedSlots: {customRender: 'orderStatus'},
        },
        {
          title: '交易金额',
          align: 'center',
          width: 100,
          dataIndex: 'paymentAmount',
          scopedSlots: {customRender: 'paymentAmount'},
        },
        {
          title: '操作',
          dataIndex: 'action',
          scopedSlots: {customRender: 'action'},
          align: 'center',
          width: 180,
          fixed: 'right'
        }
      ],
      columnsRecord:[
        {
          title: '交易发起时间',
          align: 'center',
          width: 170,
          dataIndex: 'paymentTime'
        },
        {
          title: '订单号',
          align: 'center',
          width: 120,
          dataIndex: 'orderNo',
          scopedSlots: {customRender: 'orderNo'},
        },
        {
          title: '交易关联企业',
          dataIndex: 'entName',
          align: 'center',
          width: 260,
          scopedSlots: {customRender: 'entName'},
        },
        {
          title: '交易类型',
          dataIndex: 'subitem',
          align: 'center',
          width: 180,
          scopedSlots: {customRender: 'subitem'},
        },
        {
          title: '交易状态',
          align: 'center',
          width: 180,
          dataIndex: 'orderStatus',
          scopedSlots: {customRender: 'orderStatus'},
        },
        {
          title: '支付类型',
          align: 'center',
          width: 120,
          dataIndex: 'type',
          scopedSlots: {customRender: 'type'},
        },
        {
          title: '支付方类型',
          align: 'center',
          width: 150,
          dataIndex: 'payerType',
          scopedSlots: {customRender: 'payerType'},
        },
        {
          title: '交易金额（元）',
          align: 'center',
          width: 150,
          dataIndex: 'paymentAmount',
          scopedSlots: {customRender: 'paymentAmount'},
        },
        {
          title: '交易完成时间',
          align: 'center',
          width: 170,
          dataIndex: 'finishTime'
        },
      ],
      selectedRowKeys: [],  //批量支付数据id
      selectedRows:[],//批量支付数据
      /* 分页参数 */
      ipagination:{
        current: 1,
        pageSize: 10,
        total: 0,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return " 共" + total + "条"
        },
        showSizeChanger: true,
      },
      entCollections:[],//支付企业id集合
      //提示集合
      confirmList:[
        {//单个企业渠道总提醒
          title: '您选择的支付订单中，同时包含税费订单及服务费订单，合并支付仅支持使用渠道通用账户支付！',
          content: '若您需要使用其他方式支付，请取消勾选服务费订单，谢谢!',
          okText: '前往支付',
          okType: 'primary',
          okButtonProps: false,
          cancelText: '重新选择',
        },
        {//单个企业非渠道总提醒
          title: '您选择的支付订单中，同时包含税费订单及服务费订单，合并支付仅支持使用企业通用账户支付！',
          content: '若您需要使用其他方式支付，请取消勾选服务费订单，谢谢!',
          okText: '前往支付',
          okType: 'primary',
          okButtonProps: false,
          cancelText: '重新选择',
        },
        {//多个企业渠道总提醒
          title: '您选择的支付订单中，同时包含税费订单及服务费订单，合并支付仅支持使用渠道通用账户支付！',
          content: '若您需要使用其他方式支付，请取消勾选服务费订单，谢谢!',
          okText: '前往支付',
          okType: 'primary',
          okButtonProps: false,
          cancelText: '重新选择',
        },
        {//多个企业非渠道总提醒
          title: '您选择的支付订单中，存在多个企业的服务费订单，无法进行合并支付！',
          content: '',
          okText: '前往支付',
          okType: 'primary',
          okButtonProps: true,
          cancelText: '重新选择',
        },
        {//多个企业渠道总&非渠道总提醒
          title: '您选择的支付订单中，同时包含渠道总及非渠道总两种模式的企业，无法进行合并支付！',
          content: '',
          okText: '前往支付',
          okType: 'primary',
          okButtonProps: true,
          cancelText: '重新选择',
        },
        {//多个非渠道总税费订单提醒
          title: '您选择的订单中含多个支付主体，需要合井支付，仅支持使用渠道税费账户支付或扫码支付！',
          content: '',
          okText: '前往支付',
          okType: 'primary',
          okButtonProps: false,
          cancelText: '重新选择',
        }

      ],
    }
  },
  created() {
    this.getFundSubBalanceFun();
    this.getTableData();
    this.getOrderPayPaidListFun();
    this.subitemTypeData = Storage.get('SubitemType');
    console.log(123,this.subitemTypeData)
    this.getProtocolTypeFun()
  },
  computed: {
    rowSelection() {
      return {
        onChange: (selectedRowKeys, selectedRows) => {
          console.log(`下标: ${selectedRowKeys}`, '数据: ', selectedRows);
          this.selectedRowKeys = selectedRowKeys;
          this.selectedRows = selectedRows;
        },
        getCheckboxProps: record => ({
          props: {
            disabled: record.orderStatus[0] === 9,
          },
        }),
      };
    },
  },
  methods:{
    async callback(key) {
      this.activeKey = key
      if(key == 1){
        this.getTableData();
      }else{
        this.getOrderPayPaidListFun();
      }
    },
    //批量支付
    onRemidChange(){

    },
    //查询总包分包
    getProtocolTypeFun() {
      getProtocolType().then(res => {
        if (res.success) {
          this.balanceConfig.protocolType = res.result;
        } else {
          this.$message.warning(res.message)
        }
      })
    },
    //下载文件 用于excel导出
    handleExportXlsFun(exportObj){
      exportObj.data = this.queryParam;
      return handleExportXlsNew(exportObj,this)
    },

    /*withdrawalFun(){
      // this.visible = true;
      this.$router.push({
        path: '/myAccount/accountWithdrawal',
      });
    },*/
    goTo(typeObj) {
      let url = '';
      if (typeObj.protocolType == 1) {
        url = '/myAccount/channelAccount'
      } else if (typeObj.protocolType == 2) {
        url = '/myAccount/entAccountList'
      }
      this.$router.push({
        path: url,
        query:{
          pagetab:typeObj.pagetab
        }
      });
    },

    //首次获取表格数据
    getTableData(){
      this.loading = true;
      let params = cloneObject(this.queryParams); //查询条件
      getPayUnpaidList(params).then(res => {
        if (res.success) {
          // // 赋值表格数据
          this.tableData = res.result || [];
          for(var i = 0; i < this.tableData.length;i++){
            let orderNo=[];//订单号
            let createTime=[];//创建时间
            let legalName=[];//法人姓名
            let entName=[];//关联企业
            let entIds=[];//关联企业
            let subitem=[];//交易类型
            let orderStatus=[];//支付状态
            let paymentAmount=[];//交易金额
            let protocolType=[];//协议类型
            let action = [];
            let checkBox =[];

            for(var j = 0; j < this.tableData[i].orderPayInfoUnpaidVos.length;j++){
              orderNo.push(this.tableData[i].orderPayInfoUnpaidVos[j].orderNo)
              this.tableData[i].orderNo = orderNo;

              createTime.push(this.tableData[i].orderPayInfoUnpaidVos[j].createTime)
              this.tableData[i].createTime = createTime;
              if(this.tableData[i].orderPayInfoUnpaidVos[j].entName){
                entName.push(this.tableData[i].orderPayInfoUnpaidVos[j].entName)
              }else{
                entName.push('名称待定：（ID：'+this.tableData[i].orderPayInfoUnpaidVos[j].entId+')')
              }

              this.tableData[i].entName = entName;
              entIds.push(this.tableData[i].orderPayInfoUnpaidVos[j].entId)
              this.tableData[i].entIds = entIds;

              subitem.push(this.tableData[i].orderPayInfoUnpaidVos[j].subitem)
              this.tableData[i].subitem = subitem;

              legalName.push(this.tableData[i].orderPayInfoUnpaidVos[j].legalName);
              this.tableData[i].legalName = legalName;

              orderStatus.push(this.tableData[i].orderPayInfoUnpaidVos[j].orderStatus)
              this.tableData[i].orderStatus = orderStatus;

              paymentAmount.push(conversionElement(this.tableData[i].orderPayInfoUnpaidVos[j].paymentAmount))
              this.tableData[i].paymentAmount = paymentAmount;

              protocolType.push(this.tableData[i].orderPayInfoUnpaidVos[j].protocolType)
              this.tableData[i].protocolType = protocolType;

              // action.push(this.tableData[i].orderPayInfoUnpaidVos[j].id)
              // this.tableData[i].action = action;
            }

          }
          console.log(this.tableData)
          this.loading = false;
        }else{
          this.$message.warning(res.message)
        }

      })
    },
    //交易记录
    getOrderPayPaidListFun(){
      this.loading = true;
      let params = {}; //查询条件
      let paramsNew = cloneObject(this.queryParam);
      params.data = paramsNew;
      params.pageNo = this.ipagination.current;
      params.pageSize = this.ipagination.pageSize;
      getOrderPayPaidList(params).then(res => {
        if (res.success) {
          // // 赋值表格数据
          let data = res.result;
          for(var i = 0; i < data.records.length;i++){
            delete data.records[i].id
          }
          this.tableData1 = data.records || [];
          // 赋值总条数
          this.ipagination.total = data.total || 0;
          this.loading = false;
        }else{
          this.$message.warning(res.message)
        }

      })
    },
    //余额查询
    getFundSubBalanceFun(){
      let params = {};
      params.clientType = 2;  //1企业  2渠道
      getFundSubBalance(params).then(res => {
        if (res.success) {
          let data = res.result;
          this.balanceConfig.balanceList = data.balanceInfoVoList;
        }else{
          this.$message.warning(res.message)
        }
      })
    },
    //时间选择
    onChange(date, dateString) {
      this.queryParam.paymentTimeStart =dateString[0];
      this.queryParam.paymentTimeEnd =dateString[1];
    },
    //数组对象去重
    deduplicationMethod(arr1,arr2) {
      // console.log(1,arr1)
      // console.log(2,arr2)
      let list = arr2.filter(items => {
        //循环拿到新数组的值 使用includes函数去原数组中查找
        if (arr1.includes(items)){
          //判断结构为true进入判断 并把内容返回给新数组
          return items;
        }
      })
      this.compareTheResults = list;
    },
    deduplicationMethodNo(arr1,arr2) {
      // console.log(1,arr1)
      // console.log(2,arr2)
      let list = arr2.filter(items => {
        //循环拿到新数组的值 使用includes函数去原数组中查找
        if (!arr1.includes(items)){
          //判断结构为true进入判断 并把内容返回给新数组
          return items;
        }
      })
      this.compareTheResultsNo = list;
    },
    //单个支付
    singlePaymentFun(id){
      if(id && id != undefined){
        let selectedRowKeys = [];
        selectedRowKeys.push(id);
        let key = 'paymentOrder'
        Storage.set(key,{payInfo:selectedRowKeys});
        console.log(this.selectedRowKeys)
        console.log(Storage.get('paymentOrder'))
        this.$router.push({
          path: '/myAccount/paymentPage',
          query:{
            pi:key
          }
        });
      }
    },
    //批量支付
    batchPaymentFun(){

      if(this.entCollections.length>0){
        this.entCollections = [];
        this.subitemList = [];
        this.protocolTypeNewList = [];
      }
      if(this.selectedRowKeys.length>1){
        for(let i = 0; i < this.selectedRows.length; i++){
          for(let j = 0; j < this.selectedRows[i].entIds.length; j++){
            this.entCollections.push(this.selectedRows[i].entIds[j]);
            this.subitemList.push(this.selectedRows[i].subitem[j]);
            this.protocolTypeNewList.push(this.selectedRows[i].protocolType[j]);
          }
        }
        let entCollDeduplication = Array.from(new Set(this.entCollections));

        /*
        * entCollDeduplication的长度 大于1--多企业 否则单企业
        * */
        if(entCollDeduplication.length>1){
          /*
          * 多个企业情况
          * */
          this.deduplicationMethod(this.protocolTypeList,this.protocolTypeNewList)
          // console.log('多个企业111',this.compareTheResults)
          /*渠道总&非渠道总*/
          if(this.compareTheResults.includes(1) && this.compareTheResults.includes(2)){
            this.tipsConfirm(4);
            return;
          }else if(this.compareTheResults.includes(1)){
            this.eventFun(2,1)
          }else if(this.compareTheResults.includes(2)){
            this.eventFun(3,2)
          }

        }else{
          /*
          * 单个企业情况
          * */
          this.deduplicationMethod(this.protocolTypeList,this.protocolTypeNewList)
          // console.log('单个企业111',this.compareTheResults)
          /*渠道总*/
          if(this.compareTheResults.includes(1)){
            this.eventFun(0,1)
            /*非渠道总*/
          }else if(this.compareTheResults.includes(2)){
            this.eventFun(1,2)
          }

        }
      }else{
        this.paymentDataFun();
      }



    },
    paymentDataFun(){
      if (this.selectedRowKeys.length > 0){
        let key = 'paymentOrder'
        Storage.set(key,{payInfo:this.selectedRowKeys});
        console.log(this.selectedRowKeys)
        console.log(Storage.get('paymentOrder'))
        this.$router.push({
          path: '/myAccount/paymentPage',
          query:{
            pi:key
          }
        });
      }else {
        this.$message.warning('合并支付选中数据不能为空');
        return false;
      }
    },
    eventFun(type,protocolType){
      this.deduplicationMethod(this.taxLIst,this.subitemList)
      this.deduplicationMethodNo(this.taxLIst,this.subitemList)
      console.log('@@@@@',this.compareTheResults)
      console.log('@@@@@',this.compareTheResultsNo)
      if((this.compareTheResults.length>0 && this.compareTheResultsNo.length>0) || (this.compareTheResults.length<=0 && this.compareTheResultsNo.length>0 && protocolType == 2)){
        this.tipsConfirm(type);
        return true;
      }else if(this.compareTheResults.length>0 && this.compareTheResultsNo.length<=0 && protocolType == 2){
        this.tipsConfirm(5);
        return true;
      }else{
        this.paymentDataFun();
      }

    },
    //提醒弹窗
    tipsConfirm(num) {
      const that = this;
      this.$confirm({
        title: this.confirmList[num].title,
        content: this.confirmList[num].content,
        okText: this.confirmList[num].okText,
        okType: this.confirmList[num].okType,
        okButtonProps: {
          props: { disabled: this.confirmList[num].okButtonProps },
        },
        cancelText: this.confirmList[num].cancelText,
        onOk() {
          that.paymentDataFun();
        },
        onCancel() {
          console.log('Cancel');
        },
      });
    },
    //查询
    searchQuerys() {
      this.ipagination.current=1;
      this.getOrderPayPaidListFun();
    },
    //重置
    searchResets() {
      this.ipagination.current=1;
      this.queryParam = {};
      this.getOrderPayPaidListFun();
    },
    handleTableChange(pagination, filters, sorter) {
      //分页、排序、筛选变化时触发
      this.ipagination = pagination;
      this.getOrderPayPaidListFun();
    },
    rechargeFun(){
      this.$router.push({
        path: '/myAccount/accountRecharge',
      });
    },
    onChange1(checkedList) {
      this.indeterminate = !!checkedList.length && checkedList.length < plainOptions.length;
      this.checkAll = checkedList.length === plainOptions.length;
      this.queryParams.type = checkedList;
      if(checkedList.length<=0){
        this.queryParams.type = null;
      }else{
        this.queryParams.type = checkedList;
      }
      this.getTableData();
    },
    onCheckAllChange(e) {
      //如果选中全选的话就遍历拿出当前相对项的数组的全部值
      let newArr = []
      if(e.target.checked){
        newArr = this.plainOptions.map(item=>{
          return item.value
        })
      }
      this.checkedList = e.target.checked ? newArr:[]
      this.indeterminate = false
      this.checkAll = e.target.checked;
      if(this.checkedList.length<=0){
        this.queryParams.type = null;
      }else{
        this.queryParams.type = this.checkedList;
      }
      this.getTableData()
      console.log(111,this.queryParams)
    },
  }
}
</script>

<style scoped lang="less">
/deep/ .payment-order .ant-table-row:nth-child(odd) {
  background: #fff;
}
/deep/ .payment-order .ant-table-row:nth-child(even) {
  background: #f6f7ff;
}
.content{
  background: #fff;
  box-sizing: border-box;
  padding: 20px;
  .title{
    font-size: 20px;
    font-weight: 600;
    color: #222;
  }
  .table-div{
    padding: 20px 0;
  }
  .table-li{
    border-bottom: 1px solid #e8e8e8;
    padding: 16px;
  }
  .table-div /deep/ .ant-table-selection-column{
    padding: 0;
  }
  .table-div /deep/ .ant-table-header-column{
    padding: 16px;
  }
  .table-div /deep/ .ant-table-row-cell-break-word{
    padding: 0;
  }
}
</style>

